﻿<UserControl x:Class="WPFSolution.UserControls.Statistics"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			 xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
			 mc:Ignorable="d" Width="Auto" MinHeight="300" MinWidth="300" Height="Auto" xmlns:my="http://schemas.AvalonControls/AvalonControlsLibrary/Controls"
			 xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" FontWeight="Normal" FontStyle="Normal" xmlns:my1="clr-namespace:WPFSolution.UserControls">
    <UserControl.Resources>
        <Style x:Key="chartLineDataEmptyPoint" TargetType="chartingToolkit:LineDataPoint">
            <Setter Property="Background" Value="{Binding Fill}"/>
            <Setter Property="BorderBrush" Value="#F70000"/>
            <Setter Property="BorderThickness" Value="1.5"/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="Width" Value="10"/>
            <Setter Property="Height" Value="10"/>
            <Setter Property="Template">
                <Setter.Value>
                    <x:NullExtension></x:NullExtension>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
        <DockPanel>
		<TabControl Name="StatisticsTabControl">
			<TabItem Header="Statistics Parametre">
				<TabItem.Content >
					<ScrollViewer VerticalScrollBarVisibility="Auto">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"></ColumnDefinition>
								<ColumnDefinition Width="*"></ColumnDefinition>
								<ColumnDefinition Width="*"></ColumnDefinition>
							</Grid.ColumnDefinitions>

							<GroupBox Name="CompareOptionsGroupBox" Grid.Column="0" DockPanel.Dock="Left" Width="Auto" Header="Compare Options" IsEnabled="True">
								<StackPanel Orientation="Vertical">
									<Label>Choose Methods To Compare:</Label>
									<ListBox SelectedIndex="0" Name="MethodsListBox" SelectionMode="Multiple" SelectionChanged="MethodsListBox_SelectionChanged">
										<ListBoxItem Name="YakobiMethodItem">Implicit Yakobi Method</ListBoxItem>
										<ListBoxItem Name="SimpleMethodItem">Explicit Simple Method</ListBoxItem>
										<ListBoxItem Name="AdaptiveMethodItem">Explicit Adaptive Method</ListBoxItem>
									</ListBox>
									<Label>Dimentions Segment:</Label>
									<my:RangeSlider Name="DimentionSelectorSlider" Template="{StaticResource MatrixDimentionSelector}" RangeStart="3" RangeStartSelected="3" RangeStopSelected="20" RangeStop="100" MinRange="1" />
									<StackPanel Orientation="Vertical" Width="Auto">

										<StackPanel Orientation="Horizontal">
											<Label>From</Label>
											<TextBox MinWidth="50" Name="minDimentionTextBox" BorderThickness="0" Text="{Binding ElementName=DimentionSelectorSlider, Path=RangeStartSelected}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" IsReadOnly="True" IsEnabled="False" FontSize="16" Background="{x:Null}"></TextBox>
											<Label>To</Label>
											<TextBox MinWidth="50" Name="maxDimentionTextBox" BorderThickness="0" Text="{Binding ElementName=DimentionSelectorSlider, Path=RangeStopSelected}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" IsEnabled="False" IsReadOnly="True" FontSize="16" Background="{x:Null}"></TextBox>
										</StackPanel>
									</StackPanel>
									<StackPanel Orientation="Vertical">
										<Label>Iterations Per Dimention:</Label>
										<Slider Name="IterationsPerDimSlider" Minimum="1" Maximum="20" TickPlacement="BottomRight" IsSnapToTickEnabled="True" Value="3" IsMoveToPointEnabled="True" MouseUp="IterationsPerDimSlider_MouseUp" />
										<StackPanel Orientation="Horizontal">
											<Label>Iterations</Label>
											<TextBox MinWidth="50" Name="IterationsPerDimTextBox" BorderThickness="0" Text="{Binding ElementName=IterationsPerDimSlider, Path=Value}" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" IsReadOnly="True" IsEnabled="False" FontSize="16" Background="{x:Null}"></TextBox>
										</StackPanel>

									</StackPanel>
									<GroupBox Header="Solve Options">
										<StackPanel Orientation="Vertical">
											<DockPanel>
												<DockPanel.ToolTip>
													Maximum  100000
												Minimum  1000
												</DockPanel.ToolTip>
												<Label Width="130">
													Maximum Iterations
												</Label>
												<extToolkit:WatermarkTextBox Height="Auto" Watermark="1000" Name="maximumIterationsTextBox" MaxWidth="150" Width="Auto" LostFocus="MaximumIterationsTextBox_LostFocus" />
											</DockPanel>
											<DockPanel>
												<DockPanel.ToolTip>
													Maximum 0,01
												Minimum 0,000001
												</DockPanel.ToolTip>
												<Label Width="130">
													Accuracy
												</Label>
												<extToolkit:WatermarkTextBox Height="Auto" Watermark="0,001" Name="accuracyTextBox" MaxWidth="150" Width="Auto" LostFocus="AccuracyTextBox_LostFocus" />
											</DockPanel>
                                            <DockPanel>
                                                <Label DockPanel.Dock="Left" Width="130">
                                                Show variance Lines
                                                </Label>
                                                <CheckBox Name="ShowVarianceLines" HorizontalAlignment="Center" VerticalAlignment="Center"></CheckBox>
                                            </DockPanel>
										</StackPanel>
									</GroupBox>
									<Button Name="BuldStatisticsButton" Width="150" Height="40" FontSize="18" Click="BuldStatisticsButton_Click">
										Build Statistics
									</Button>
								</StackPanel>
							</GroupBox>
							<StackPanel Name="CalculationStackPanel" Grid.Column="1">
								<Label FontSize="20">Process Status:</Label>
								<ProgressBar Name="CalculationProgressBar" Height="30"></ProgressBar>
								<TextBlock Name="CalculationStatusTextBlock"></TextBlock>
								<Button MaxWidth="150" FontSize="16" Visibility="Collapsed" Name="CancelButton" Click="CancelButton_Click">Cancel</Button>
							</StackPanel>
						</Grid>
					</ScrollViewer>
				</TabItem.Content>

			</TabItem>
		</TabControl>
	</DockPanel>
</UserControl>
